<?php
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript" src="/statics/js/calendar2/WdatePicker.js"></script>
<script type="text/javascript">
 
</script>
<script type="text/javascript">


    $(function(){
        $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
        $("#name").formValidator({onshow:"请输入客户姓名",onfocus:"请输入客户姓名",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入客户姓名"});
        $("#email").formValidator({onshow:"请输入邮箱",onfocus:"请输入邮箱",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入邮箱"});
        $("#phone").formValidator({onshow:"请输入电话",onfocus:"请输入电话",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入电话"});
        $("#address").formValidator({onshow:"请输入地址",onfocus:"请输入地址",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入地址"});
        
        
    });

   
</script>
<STYLE>
    .Wdate{
        background: #fff url("../images/input.png") repeat-x scroll 0 0;
        border: 1px solid #d0d0d0;
        font-family: Verdana,Geneva,sans-serif,"宋体";
        font-size: 12px;
        height: 18px;
        margin: 0 5px 0 0;
        padding: 2px 0 2px 5px;
    }
</STYLE>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='<?php echo U('measure/index');?>'><em>预约列表</em></a><span>|</span>
        <a href='javascript:;' class="on"><em>修改预约</em></a>
    </div>
</div>
<div class="pad_10">
    <div class="common-form">
        <form method="post" enctype="multipart/form-data" name="myform" id="myform">
            <table width="100%" class="table_form contentWrap">
                <tr>
                    <td width="80">姓名</td>
                    <td><input type="text" class="input-text" id="name" name="name" value="<?php echo $row['name']?>"/></td>
                </tr>
                 <tr>
                    <td width="80">电话</td>
                    <td><input type="text" class="input-text" id="phone" name="phone" value="<?php echo $row['phone']?>"/></td>
                </tr>
                <tr>
                    <td width="80">量体方式</td>
                    <td>
                        <select name="class_id" id="class_id" onchange="change_class_id(this.value)">
                            <option value="0">请选择</option>
                            <option value="1" <?php echo $row['class_id']==1?"selected":""?>>到店量体</option>
                            <option value="2" <?php echo $row['class_id']==2?"selected":""?>>上门量体</option>
                        </select>
                    </td>
                </tr>
                <tr id="address_tr" <?php if($row['class_id']==1||!$row['class_id']){?>style="display:none;"<?php }?>>
                    <td width="80">客户地址</td>
                    <td><input type="text" class="input-text" id="address" name="address"  size="80" value="<?php echo $row['address']?>"/></td>
                </tr>
                <tr id="store_tr" <?php if($row['class_id']==2||!$row['class_id']){?>style="display:none;"<?php }?>>
                    <td width="80">门店地址</td>
                        <td>
                            <select name="store_id" id="store_id" >
                                <option value="0">请选择</option>
                                <option value="1" <?php echo $row['store_id']==1?"selected":""?>>工厂店</option>
                                <option value="2" <?php echo $row['store_id']==2?"selected":""?>>体验店</option>
                            </select>
                        </td>
                </tr>
                <tr  <?php if($row['class_id']==2||!$row['class_id']){?>style="display:none;"<?php }?> id="arrival_time_tr">
                    <td width="80">到店时间</td>
                    <td><input class="Wdate" name="arrival_time" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" size="20" value="<?php echo date("Y-m-d H:i:s",$row['arrival_time'])?>"/></td>
                </tr>
                <tr>
                    <td width="80">备注</td>
                    <td><textarea cols="50" rows="10" id="remark" name="remark"><?php echo $row['remark']?></textarea></td>
                </tr>

             </table>

            <div class="bk15"></div>
            <input name="dosubmit" type="submit" value="提交" class="button" id="dosubmit" onclick="add_comment()"/>
        </form>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
function change_class_id(class_id){
     if(class_id==1){//到店量体
         $("#arrival_time_tr").css("display","");
         $("#store_tr").css("display","");
         $("#address_tr").css("display","none");

     }else if(class_id==2){
         $("#arrival_time_tr").css("display","none");
         $("#store_tr").css("display","none");
         $("#address_tr").css("display","");
     }
}
</script>